package java67_adv8;

public class Worker extends Thread {
	public Worker(String n) {
		super(n);
	}

	@Override
	public void run() {
		while (true) {
			System.out.println(String.format("工人%s干了一会活", getName()));
			try {
				sleep(1000);
				System.out.println(super.getName() + "睡醒了,继续干活");
			} catch (InterruptedException e) {
				System.out.println(super.getName() + "被喊醒,继续干活");
				e.printStackTrace();
			}
		}
	}
}
